<?php

namespace common\model;

use think\model\RelationModel;

class ReviewWorkflowNodeModel extends RelationModel
{

    //自动验证
    protected $_validate = [
        ['role_code', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
        ['review_workflow_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_BOTH],//必须字段
        ['review_workflow_id', '', '', self::MUST_VALIDATE, 'integer', self::MODEL_BOTH],//必须字段
        ['parent_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],
        ['parent_id', '', '', self::EXISTS_VALIDATE, 'integer', self::MODEL_BOTH],//必须字段
        ['role_code', '0,36', '', self::EXISTS_VALIDATE, 'length'],
    ];

    //自动完成
    protected $_auto = [
        ['uuid', 'create_uuid', self::MODEL_INSERT, 'function'],
        ['is_deleted', 'no', self::MODEL_INSERT, 'string'], //自动填充删除状态
    ];

}
